'themify-social-links', 'description' => __('Social media links.', 'themify') ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'themify-social-links' ); /* Create the widget. */ parent::__construct( 'themify-social-links', __('Themify - Social Links', 'themify'), $widget_ops, $control_ops ); } /////////////////////////////////////////// // Widget /////////////////////////////////////////// function widget( $args, $instance ) { /** This filter is documented in wp-includes/default-widgets.php */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); /* Before widget (defined by themes). */ echo $args['before_widget']; if ( $title ) { echo $args['before_title'] , $title , $args['after_title']; } $data = themify_get_data(); $pre = 'setting-link_'; $field_ids = isset( $data[$pre.'field_ids'] ) ? json_decode( $data[$pre.'field_ids'] ) : ''; if ( is_array( $field_ids ) || is_object( $field_ids ) ) { $show_link_name = !empty( $instance['show_link_name'] ); $new_window_attr = !empty( $instance['open_new_window'] ) ? 'target="_blank" rel="noopener"' : ''; $icon_type = themify_get( $pre . 'icon_type','image-icon',true ); // Icon Size $icon_size = !empty($instance['icon_size']) ? $instance['icon_size'] : 'icon-medium'; // Orientation $orientation = !empty($instance['orientation'])? $instance['orientation'] : 'horizontal'; echo '
'; } /* After widget (defined by themes). */ echo $args['after_widget']; } /////////////////////////////////////////// // Update /////////////////////////////////////////// function update( $new_instance, $old_instance ) { $instance=array(); /* Strip tags (if needed) and update the widget settings. */ foreach(array('show_link_name','open_new_window','icon_size','orientation') as $field){ if(isset($new_instance[$field])){ $instance[$field] = $new_instance[$field]; } } if(isset($new_instance['title'])){ $instance['title'] = strip_tags( $new_instance['title'] ); } return $instance; } /////////////////////////////////////////// // Form /////////////////////////////////////////// function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => '', 'show_link_name' => false, 'open_new_window' => false, 'icon_size' => 'icon-medium', 'orientation' => 'horizontal', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?> get_field_id( 'title' ));?>
id="" name="get_field_name( 'show_link_name' ) ); ?>" />
get_field_id( 'open_new_window' ));?>id="" name="get_field_name( 'open_new_window' ) ); ?>" />
get_field_id( 'icon_size' ));?>get_field_id( 'orientation' ));?>
Manage links at Themify > Settings > Social Links.', 'themify' ), esc_url( admin_url( 'admin.php?page=themify#setting-social_links' ) ) ) ); ?>
'feature-posts', 'description' => __('A list of posts, optionally filter by category.', 'themify') ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'themify-feature-posts' ); /* Create the widget. */ parent::__construct( 'themify-feature-posts', __('Themify - Feature Posts', 'themify'), $widget_ops, $control_ops ); } /** * Adds aria-hidden attribute if $condition is set * * @return string|null */ private static function aria_hidden( $condition, $echo = true ) { if( $condition ) { if( $echo ) { echo ' aria-hidden="true"'; } return ' aria-hidden="true"'; } } /////////////////////////////////////////// // Widget /////////////////////////////////////////// function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $category = isset( $instance['category'] ) ? $instance['category'] : 0; $show_count = isset( $instance['show_count'] ) ? $instance['show_count'] : 5; $show_date = isset( $instance['show_date'] ); $show_thumb = isset( $instance['show_thumb'] ); $display = isset( $instance['display'] )? $instance['display'] : false; $show_excerpt = !empty( $instance['show_excerpt'] ); $excerpt_length = isset( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 55; $show_title = !isset( $instance['hide_title'] ); $show_read_more = isset( $instance['show_read_more'] ); $read_more_text = empty( $instance['read_more_text'] ) ? '' : $instance['read_more_text'] ; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'date'; $order = isset( $instance['order'] ) ? $instance['order'] : 'DESC'; $query_opts = apply_filters( 'themify_query', array( 'posts_per_page' => $show_count, 'post_type' => 'post', 'orderby' => $orderby, 'order' => $order, 'no_found_rows'=>true, 'ignore_sticky_posts'=>true, 'suppress_filters' => false, 'cache_results'=>false ), $instance, $this->id_base ); if ( $category ) $query_opts['cat'] = $category; $loop = get_posts($query_opts); if($loop) { /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) { echo $args['before_title'] , $title , $args['after_title']; } echo '
get_field_id( 'orderby' ));?>
get_field_id( 'order' ));?>
get_field_id( 'show_count' ));?>
get_field_id( 'hide_title' ));?>
id="" name="get_field_name( 'hide_title' ) ); ?>" />
get_field_id( 'show_date' ));?>id="" name="get_field_name( 'show_date' ) ); ?>" />
get_field_id( 'show_thumb' ));?>id="" name="get_field_name( 'show_thumb' ) ); ?>" />
get_field_id( 'thumb_width' )); ?>x
get_field_id( 'display' ));?>get_field_id( 'excerpt_length' ));?>
id="" name="get_field_name( 'show_read_more' ) ); ?>" />
get_field_id( 'read_more_text' ));?>'list-pages', 'description' => __('A list of pages', 'themify') ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'themify-list-pages' ); /* Create the widget. */ parent::__construct( 'themify-list-pages', __('Themify - List Pages', 'themify'), $widget_ops, $control_ops ); } /////////////////////////////////////////// // Widget /////////////////////////////////////////// function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $parent = isset( $instance['parent'] ) ? $instance['parent'] : ''; $depth = isset( $instance['depth'] ) ? $instance['depth'] : 0; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : false; $exclude = isset( $instance['exclude'] ) ? $instance['exclude'] : false; /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) { echo $args['before_title'] , $title , $args['after_title']; } echo '
get_field_id( 'depth' ));?>
get_field_id( 'orderby' ));?>
get_field_id( 'exclude' ));?>
__('All', 'themify'), 'orderby' => 'name', 'hierarchical' => 1, 'selected' => $instance['parent'], 'id' => $field, 'name' => $this->get_field_name( 'parent' ), )); ?>
get_field_id( 'depth' ));?>get_field_id( 'orderby' ));?>
get_field_id( 'exclude' ));?>
id="" name="get_field_name( 'show_dropdown' ) ); ?>" />
get_field_id( 'show_counts' ));?>id="" name="get_field_name( 'show_counts' ) ); ?>" />
get_field_id( 'show_hierarchy' ));?>id="" name="get_field_name( 'show_hierarchy' ) ); ?>" />
'recent-comments', 'description' => __('A list of recent comments from all posts', 'themify') ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'themify-recent-comments' ); /* Create the widget. */ parent::__construct( 'themify-recent-comments', __('Themify - Recent Comments', 'themify'), $widget_ops, $control_ops ); } /////////////////////////////////////////// // Widget /////////////////////////////////////////// function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $show_count = isset( $instance['show_count'] ) ? $instance['show_count'] : 3; $show_avatar = isset( $instance['show_avatar'] ) ? $instance['show_avatar'] : false; $avatar_size = isset( $instance['avatar_size'] ) ? $instance['avatar_size'] : 32; $excerpt_length = isset( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 60; $comments = get_comments(array( 'number' => $show_count, 'status' => 'approve', 'type' => 'comment' )); if($comments){ /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) { echo $args['before_title'] , $title , $args['after_title']; } echo '
get_field_id( 'avatar' ));?>
id="" name="get_field_name( 'show_avatar' ) ); ?>" />
get_field_id( 'avatar_size' ));?>px
get_field_id( 'excerpt_length' ));?>'links', 'description' => __('A list of bookmarks', 'themify') ); /* Widget control settings. */ $control_ops = array( 'id_base' => 'themify-links' ); /* Create the widget. */ parent::__construct( 'themify-links', __('Themify - Banners & Links', 'themify'), $widget_ops, $control_ops ); } /////////////////////////////////////////// // Widget /////////////////////////////////////////// function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $category = isset( $instance['category'] ) ? $instance['category'] : ''; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'rand'; $show_count = isset( $instance['show_count'] ) ? $instance['show_count'] : ''; $show_thumb = isset( $instance['show_thumb'] ) ? $instance['show_thumb'] : false; $show_name = isset( $instance['show_name'] ) ? $instance['show_name'] : false; $show_desc = isset( $instance['show_desc'] ) ? $instance['show_desc'] : false; /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) { echo $args['before_title'] , $title , $args['after_title']; } echo '
get_field_id( 'orderby' ));?>
get_field_id( 'show_count' ));?>
get_field_id( 'show_thumb' ));?>
id="" name="get_field_name( 'show_thumb' ) ); ?>" />
get_field_id( 'show_name' ));?>id="" name="get_field_name( 'show_name' ) ); ?>" />
get_field_id( 'show_desc' ));?>id="" name="get_field_name( 'show_desc' ) ); ?>" />
'themify-most-commented', 'description' => __('A list with the most commented posts.', 'themify') ); $control_ops = array( 'id_base' => 'themify-most-commented' ); parent::__construct( 'themify-most-commented', __('Themify - Most Commented', 'themify'), $widget_ops, $control_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $show_count = isset( $instance['show_count'] ) ? $instance['show_count'] : 10; $show_excerpt = isset( $instance['show_excerpt'] ) ? $instance['show_excerpt'] : false; $show_thumb = isset( $instance['show_thumb'] ) ? $instance['show_thumb'] : false; $thumb_width = isset( $instance['thumb_width'] ) ? $instance['thumb_width'] : 50; $thumb_height = isset( $instance['thumb_height'] ) ? $instance['thumb_height'] : 50; $excerpt_length = isset( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 55; $hide_title = isset( $instance['hide_title'] ) ? $instance['hide_title'] : false; $show_comment_count = isset( $instance['show_comment_count'] ) ? $instance['show_comment_count'] : false; $loop = get_posts( array( 'numberposts' => $show_count, 'orderby' => 'comment_count', 'post_type' => 'post', 'order' => 'DESC', 'ignore_sticky_posts'=>true, 'suppress_filters' => false, 'cache_results'=>false ) ); if ( $loop ) { /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ( $title ) { echo $args['before_title'] , $title , $args['after_title']; } echo '
id="" name="get_field_name( 'hide_title' ) ); ?>" />
get_field_id( 'show_comment_count' ));?>id="" name="get_field_name( 'show_comment_count' ) ); ?>" />
get_field_id( 'show_count' ));?>get_field_id( 'show_thumb' ));?>
id="" name="get_field_name( 'show_thumb' ) ); ?>" />
get_field_id( 'thumb_width' )); ?>x
get_field_id( 'show_excerpt' )); ?>id="" name="get_field_name( 'show_excerpt' ) ); ?>" />
get_field_id( 'excerpt_length' ));?>
>
>
get_field_id( 'height' ));?>
get_field_id( 'zoom_map' ));?>get_field_id( 'type_map' ));?>
get_field_id( 'scrollwheel_map' ));?>
get_field_id( 'draggable_map' ));?>
get_field_id( 'draggable_disable_mobile_map' ));?>
get_field_id( 'info_window_map' ));?>